const
    http = require("http"),
    fs = require("fs");

http.createServer((request, response) => {
    let str = request.headers.referer;

    response.writeHead(200, { "Content-Type": "text/html" });

    if (str) {
        console.log(str);
        console.log(str.split('/').slice(3).join('/'));
        response.write(str);
    }
    response.end();


}).listen(7000);